// requestTool.js
// status - 包含请求的状态（"success"、"notmodified"、"error"、"timeout"、"parsererror"）

function computeVolumeOfFlow(retStr) {
    var volumeOfFlow = $api.getStorage('volumeOfFlow');
    if (volumeOfFlow == undefined || volumeOfFlow == null) {
        volumeOfFlow = "0";
    }
    var volumeLength = parseInt(volumeOfFlow);
    var newLength = volumeLength + lenFor(retStr);
    $api.setStorage('volumeOfFlow', newLength.toString());
    api.toast({
        msg: bytesToSize(newLength)
    });
}

function lenFor(str) {
    var byteLen = 0, len = str.length;
    if (str) {
        for (var i = 0; i < len; i++) {
            if (str.charCodeAt(i) > 255) {
                byteLen += 2;
            } else {
                byteLen++;
            }
        }
        return byteLen;
    } else {
        return 0;
    }
}

//b转换成kb
function bytesToSize(bytes) {
    if (bytes === 0)
        return '0 B';

    var k = 1024;

    sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];

    i = Math.floor(Math.log(bytes) / Math.log(k));

    return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
    //toPrecision(3) 后面保留一位小数，如1.0GB                                                                                                                  //return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}

var timeout = 5;
//超时10秒
/*
 *	URL
 *	params			请求参数
 *	cache 			是否缓存
 *	callback 		回调函数 返回data - 字符串数据 和 status - 包含请求的状态（"success"、"notmodified"、"error"、"timeout"、"parsererror"）
 *	ret.status      等于1/true成功，暂不支持其他返回类型
 */
function cfnetppPOST(URL, params, cache, callback) {
    params["appkey"] = "3905cb54d9b7a989eb535e75eb8deac0";
    var res = Object.keys(params).sort();
    var result = "";

    var num = 0;
    for (var key in res) {
        if (params[res[key]] === undefined)
            continue;
        if (typeof (params[res[key]]) == "string" && (params[res[key]] === "" || params[res[key]] === "0"))
            continue;
        if (typeof params[res[key]] == "number" && params[res[key]] === 0)
            continue;
        if (num !== 0)
            result += "&";
        result += res[key];
        if (params[res[key]] instanceof Object || params[res[key]] instanceof Array) {
            result += "="+JSON.stringify(params[res[key]]);
        } else {
            result += "=" + params[res[key]];
        }
        num++;
    }
    console.log("md5:" + result);
    params["appkey"] = MD5(result).toUpperCase();
    if (cache) {
        var fileName = MD5(URL + JSON.stringify(params));
        var filePath = api.cacheDir + '/requestCache/' + fileName + '.txt';
        api.ajax({
            url: URL,
            method: 'post',
            timeout: timeout,
            headers: {"app": "ryanrq"},
            data: {
                values: params
            }
        }, function (ret, err) {
            if (ret) {
                try {
                    console.log($api.jsonToStr(ret) + "  by  " + URL + " params:" + JSON.stringify(params));
                } catch (e) {

                }
                callback(ret, 'success');
                // console.log();
                if (ret.status == 1 || ret.status == 'true' || ret.code == 200) {
                    writeData(filePath, JSON.stringify(ret), function (ret, err) {
                    });
                }
            } else {
                console.log("加载错误" + JSON.stringify(params) + "url:" + URL);
                // callback('', err);
                readData(filePath, function (ret, cacheData) {
                    if (ret == true) {
                        var cacheObjc = JSON.parse(cacheData);
                        if (cacheObjc.status == 1 || cacheObjc.status == 'true' || cacheObjc.code == 200) {
                            callback(cacheObjc, 'success');
                        } else {
                            callback('', err);
                        }
                    } else {
                        callback('', err);
                    }
                });
            }
        });
    } else {
        api.ajax({
            url: URL,
            method: 'post',
            timeout: timeout,
            dataType: 'json',
            headers: {"app": "ryanrq"},
            data: {
                values: params,
            }
        }, function (ret, err) {
            try {
                console.log($api.jsonToStr(ret) + "  by  " + URL + " params:" + JSON.stringify(params));
            } catch (e) {
                console.log(ret);
            }
            if (ret) {
                callback(ret, 'success');
            } else {
                callback('', err);
            }
        });
    }
}

function cfnetppGET(URL, cache, callback) {
    if (cache) {
        var fileName = MD5(URL);
        var filePath = api.cacheDir + '/requestCache/' + fileName + '.txt';
        api.ajax({
            url: URL,
            method: 'get',
            timeout: timeout
        }, function (ret, err) {
            // computeVolumeOfFlow(JSON.stringify(ret));
            if (ret) {
                callback(ret, 'success');
                try {
                    console.log($api.jsonToStr(ret) + "  by  " + URL);
                } catch (e) {

                }
                if (ret.status == 1 || ret.status == 'true') {//成功status返回1
                    writeData(filePath, JSON.stringify(ret), function (ret, err) {
                    });
                }
            } else {
                readData(filePath, function (ret, cacheData) {
                    if (ret == true) {
                        var cacheObjc = JSON.parse(cacheData);
                        if (cacheObjc.status == 1 || cacheObjc.status == 'true') {
                            callback(cacheObjc, 'success');
                        } else {
                            callback('', err);
                        }
                    } else {
                        callback('', err);
                    }
                });
            }
        });
    } else {
        api.ajax({
            url: URL,
            method: 'get',
            timeout: timeout
        }, function (ret, err) {
            // computeVolumeOfFlow(JSON.stringify(ret));
            try {
                console.log($api.jsonToStr(ret) + "  by  " + URL);
            } catch (e) {

            }
            if (ret) {
                callback(ret, 'success');
            } else {
                callback('', err);
            }
        });
    }
}

//写入数据
function writeData(filePath, dataStr, callback) {
    var fs = api.require('fs');
    fs.createFile({
        path: filePath
    }, function (ret, err) {
        fs.open({
            path: filePath,
            flags: 'read_write'
        }, function (ret, err) {
            if (ret.status) {
                var fd = ret.fd;
                //获取句柄
                fs.write({
                    fd: fd,
                    data: dataStr,
                    offset: 0,
                    overwrite: true//覆盖偏移位置后内容
                }, function (ret, err) {
                    callback(ret, err);
                });
            }
        });
    });
}

//读取数据
function readData(filePath, callBack) {
    var fs = api.require('fs');
    fs.open({
        path: filePath,
        flags: 'read_write'
    }, function (ret, err) {
        if (ret.status) {
            var fd = ret.fd;
            //获取句柄
            fs.read({
                fd: fd,
                offset: 0
            }, function (ret, err) {
                if (ret.status) {
                    callBack(true, ret.data);
                } else {
                    callBack(false, '');
                }
            });
        } else {
            callBack(false, '');
        }
    });
}

//发送用户行为轨迹通知(学习模块)
function SendBehaviorTrajectoriesNotifi_Study(data) {

    api.sendEvent({
        name: 'BehaviorTrajectoriesNotifi_Study',
        extra: {
            data: data
        }
    });
}

function SendBehaviorTrajectoriesNotifi(busionessid, pagetype, pagetypeid) {

}


//业务操作日志
//$operacttypename：业务功能名称，当然操作的一级功能，比如：首页模块
//$operacttype：业务功能ID，标识，唯一性，
//$indata：入参，指当前请求的数据
//$requestdata：请求的参数：当前POST的数据
//$responsedata：出参：当前输出的结果集
//$insqlstr：执行的SQL语句，如无可为空
//$source：方法名称，二级功能，比如查询课程
//managerid//方法名称ID，唯一性，自定义ID
function SendBusinessOperationsLogNotifi(operacttypename, operacttype, indata, requestdata, insqlstr, responsedata, source, sourceid) {

    api.sendEvent({
        name: 'BusinessOperationsNotifi',
        extra: {
            operacttypename: operacttypename,
            operacttype: operacttype,
            indata: indata,
            requestdata: requestdata,
            insqlstr: insqlstr,
            responsedata: responsedata,
            source: source,
            sourceid: sourceid
        }
    });

}

//busionessid ////来源功能,操作类型ID ，如0进入、1跳出fasle
//Source//来源功能,操作类型名称，如0进入、1跳出
//pagetype//功能页面名称
//pagetypeid //功能页面ID
//sourcedomain//来源站点网址
//param.sourceur //来源页面地址
//sourcetitle//来源页面标题
//param.accessdomain//受访页面网址
//accesspageurl//受访页面地址
//accesspagetitle//受访页面标题
//serachengine//搜索引擎
//operactid //操作人ID
//operactname//操作人名称
//operactype//操作人角色
//发送用户行为轨迹通知(除学习模块外)
function SendBehaviorTrajectoriesNotifi1(busionessid, pagetype, pagetypeid, sourceurl, sourcetitle, accesspageurl, accesspagetitle) {
    api.sendEvent({
        name: 'TestBehaviorTrajectoriesNotifi',
        extra: {
            busionessid: busionessid,
            pagetype: pagetype,
            pagetypeid: pagetypeid,
            sourceurl: sourceurl,
            sourcetitle: sourcetitle,
            accesspageurl: accesspageurl,
            accesspagetitle: accesspagetitle,
        }
    });
}


//busionessid ////来源功能,操作类型ID ，如0进入、1跳出
//Source//来源功能,操作类型名称，如0进入、1跳出
//pagetype//功能页面名称
//pagetypeid //功能页面ID
//sourcedomain//来源站点网址
//param.sourceur //来源页面地址
//sourcetitle//来源页面标题
//param.accessdomain//受访页面网址
//accesspageurl//受访页面地址
//accesspagetitle//受访页面标题
//serachengine//搜索引擎
//operactid //操作人ID
//operactname//操作人名称
//operactype//操作人角色
//message//附加信息
//发送用户行为轨迹通知(认证模块)
function SendBehaviorTrajectoriesNotifi_Authentication(busionessid, pagetype, pagetypeid, sourceurl, sourcetitle, accesspageurl, accesspagetitle, message) {
    api.sendEvent({
        name: 'BehaviorTrajectoriesNotifi_Authentication',
        extra: {
            busionessid: busionessid,
            pagetype: pagetype,
            pagetypeid: pagetypeid,
            sourceurl: sourceurl,
            sourcetitle: sourcetitle,
            accesspageurl: accesspageurl,
            accesspagetitle: accesspagetitle,
            message: message
        }
    });
}

//浏览课程时调用
function addCourseBrowsWithCid(cid) {
    cfnetppPOST(url_courseBrowsUrl, {cid: cid}, false, function (data, status) {

    });
}

var ip;
var masterIp;
var payAddress;
var type = 0;//0正式环境，1正式预上线，2测试


if (type === 0) {
    // https://apibase.cfnet.org.cn/
    ip = 'https://apibase.cfnet.org.cn/index.php/';//正式
    //ip = 'http://base.zjjj.cfnet.org.cn/index.php/';//正式
    masterIp = 'http://train.cfnet.org.cn?m=api&c=';//正式
    payAddress = 'http://pay.cfnet.org.cn/generate/';
} else if (type === 2) {
    ip = 'http://base.cfnet.org.cn/index.php/';//测试
    masterIp = 'http://trainv2.cfnet.org.cn?m=api&c=';//测试
    payAddress = 'http://test.pay.cfnet.org.cn/generate/';
} else {
    ip = 'http://sim.apibase.cfnet.org.cn/index.php/';//正式
    masterIp = 'http://train.cfnet.org.cn?m=api&c=';//正式
    payAddress = 'http://pay.cfnet.org.cn/generate/';
}

// 默认正式服
// var ip = 'http://apibase.cfnet.org.cn/index.php/';
// var masterIp = 'http://train.cfnet.org.cn?m=api&c=';

// var netStatus = $api.getStorage('app_net_status');
// if (netStatus != undefined && netStatus != null) {
// 	if (netStatus == '1') {
// 		ip = 'http://apibase.cfnet.org.cn/index.php/';//正式
// 		masterIp = 'http://train.cfnet.org.cn?m=api&c=';
// 	}else{
// 		ip = 'http://base.cfnet.org.cn/index.php/';//测试
// 		masterIp = 'http://trainv2.cfnet.org.cn?m=api&c=';
// 	}
// }else{
// 	ip = 'http://apibase.cfnet.org.cn/index.php/';//正式
// 	masterIp = 'http://train.cfnet.org.cn?m=api&c=';
// }

//url前缀
var urlPrefix = ip;
//var urlPrefix = ip ;

//测试地址
//用户行为轨迹测试测试
var url_InsertUserManagerLogApp = urlPrefix + 'statislog/manager_syslog/InsertUserManagerLogApp';
//业务操作测试
var url_InsertManagerLogByapp = urlPrefix + 'statislog/manager_syslog/InsertManagerLogByapp';


//用户行为轨迹
var UrlBehaviorTrajectories = urlPrefix + 'statislog/manager_syslog/UserManagerLog';


//7.8提交周报接口
var urlAddact = urlPrefix + 'weekly/weekly/addact';
//7.9学生端周报列表接口
var urlXswk = urlPrefix + 'weekly/weekly/xswk';
//7.10.学生端提交实习部门信息接口(暂时不用)
var urlXsdepartment = urlPrefix + 'weekly/weekly/xsdepartment';
//7.11.教师端周报列表接口
var urlLswk = urlPrefix + 'weekly/weekly/lswk';
//7.12.教师端评价周报接口
var urlLsevaluate = urlPrefix + 'weekly/weekly/lsevaluate';
//7.13班级列表接口：(获取当前集团/院校)
var urlClassname = urlPrefix + 'classes/classes/classname';
//7.14.教师端批量更改学生实习状态接口
var urlInternship = urlPrefix + 'plan/plan/internShip';
//7.15.获取企业列表 get
var urlCompanylist = urlPrefix + 'classes/classes/companylist';
//7.16.获取岗位列表
var urlPostlist = urlPrefix + 'classes/classes/worklist';
//7.17获取老师管理班级
var urlClasslist = urlPrefix + 'classes/classes/classlist';
//7.18获取老师管理班级学生
var urlStudentlist = urlPrefix + 'classes/classes/studentlist';
//7.19.签到接口
var urlSign = urlPrefix + 'sign/sign_manager/sign';
//7.20.签到列表
var urlSignlist = urlPrefix + 'sign/sign_manager/signlist';
//7.21.提交月报接口
var urlMonth = urlPrefix + 'weekly/weekly/month';
//7.22.学生端月报列表接口
var urlXsmonth = urlPrefix + 'weekly/weekly/xsmonth';
//7.23.提交实习报告接口
var urlGraduation = urlPrefix + 'plan/plan/graduation';
//7.28教师端查看签到情况接口
var urlSeesign = urlPrefix + 'sign/sign_manager/seesign';
//7.29.教师端查看月报列表接口
var urlLsmonth = urlPrefix + 'weekly/weekly/lsmonth';
//7.30教师端查看月报详情接口
var urlLsydetails = urlPrefix + 'weekly/weekly/lsydetails';
//7.31教师端教师评价月报接口
var urlLspjmonth = urlPrefix + 'weekly/weekly/lspjmonth';
//7.32教师端实习报告列表接口
var urlGraduationlist = urlPrefix + 'plan/plan/graduationlist';
//7.33.教师端实习报告详情接口
var urlReport = urlPrefix + 'plan/plan/report';
//7.34.教师端教师评价实习报告接口
var urlJudge = urlPrefix + 'plan/plan/judge';

//7.38获取用户操作数
var urlUserNum = urlPrefix + 'sign/sign_manager/sxsum';


//7.42获取通知状态接口
var urlNotifiStatus = urlPrefix + 'sign&a=status';
//7.43发布新巡检记录
var urlAddpatro = urlPrefix + 'patrol/patrol/addPatro';
//7.44巡检记录列表
var urlPatrolist = urlPrefix + 'patrol/patrol/patrollist';

//7.45巡检记录详情
var urlPatroinfo = urlPrefix + 'patrol/patrol/patrolinfo';

//7.47根据实习企业id查实习学生
var urlCompanyStuList = urlPrefix + 'classes/classes/sxstudent';
//7.53周报详情接口
var urlLswklist = urlPrefix + 'weekly/weekly/lswklist';

//7.57学生端我的实习记录列表接口
var urlLst = urlPrefix + 'notes/notes_manager/lst';
//7.58学生端我的实习记录详情接口
var urlLstInfo = urlPrefix + 'notes/notes_manager/info';

//7.59获取教师管理实习计划下班级
var planStudentsUrl = urlPrefix + 'dailylst/dailylst_manager/planstudent';
//7.60获取教师管理实习计划
var planListUrl = urlPrefix + 'plan/plan/lshqplan';
//7.61学生端提交日报接口
var urlTjdaily = urlPrefix + 'dailylst/dailylst_manager/tjdaily';
//7.62学生端日报列表接口
var urlDailylst = urlPrefix + 'dailylst/dailylst_manager/dailylst';
//7.62学生端日报列表详情接口
var urlDailyinfo = urlPrefix + 'dailylst/dailylst_manager/dailyinfo';
//7.63教师端日报列表接口
var urlLsrblst = urlPrefix + 'dailylst/dailylst_manager/lsrblst';
//7.64教师端日报列表详情接口
var urlLswkinfo = urlPrefix + 'dailylst/dailylst_manager/lswkinfo';
//7.65教师端日报评价接口
var urlLsrbevaluate = urlPrefix + 'dailylst/dailylst_manager/lsrbevaluate';


//7.68学生端实习报告列表
var urlJybglist = urlPrefix + 'weekly/weekly/jybglist';
//7.69获取学生实习计划状态接口
var urlPracticeType = urlPrefix + 'dailylst/dailylst_manager/plnazt';
//7.79课程详情
var study_course_detail = ip + 'course/course_normal/getCourseInfo';
//开启课程，关闭课程
var url_closeVideodetail = ip + 'course/Videodetail/closeVideodetail';
////7.74上传课程、章节学习记录
var study_course_upload_record = ip + 'log/Free_Log/studyins';


//7.93百度云上传附件
var Upload_baidu = 'http://train.cfnet.org.cn/api/learnplan/uploadfile';

//7.95阿里云上传图片
var Upload_pic = "http://biz.cfnet.org.cn/aliyun/samples/uploadfile.php";

//百度云上传附件
var Upload_File = 'http://boscache.cfnet.org.cn/uploadfile.php';

//注册接口（只用于appstore审核用）
var urlRegister = ip + 'user/userlogin/regisUser';
//7.7修改密码接口
var urlUpdatepwd = ip + 'user/user/updatepwd';
//7.2用户信息接口
var urlApplst = ip + 'user/user/applst';

//7.3提交用户信息接口(即修改用户信息)
var urlEditact = ip + 'user/user/editact';

//7.5上传头像接口
var urlPhoto = ip + 'user/user/photo';
//7.1登录
var url_login = ip + 'user/Userlogin/login';
//获取集团id
var url_getJiTuanList = ip + 'user/Userlogin/getJiTuanList';
//阿里云上传图片
var Upload_File_img = ip + 'pub/Upload/uploadSingleImages';
//阿里云上传视频
var Upload_File_video = ip + 'pub/Upload/uploadSingleVideo';


//阿里云上传文档
var Upload_File_file = ip + 'pub/Upload/uploadSingleFile';

//自由课程

//学习-我的课程列表
var url_getCourseList = ip + 'course/course_normal/getCourseList';
//慕课查询单个课程学习进度
var url_getMoocSchedule = ip + 'course/course_normal/getMoocCourseSchedule';
//学习-搜索课程
var url_SearchCourse = ip + 'course/course_normal/SearchCourse';
//学习-我的历史课程列表
var url_getHistoryCourseList = ip + 'course/course_normal/getHistoryCourseList';
//自由课程/mocc课程列表接口
var url_freeChapterUrl = ip + 'course/course_normal/getChapterList';
var url_freeChapterUrlNew = ip + 'course/course_chapters/getChapterList';
//获取资源地址
var url_getCourseUrl = ip + 'course/course_chapters/getChapterResourceUrl';
//自由课程子章节列表
var url_subChapterUrl = ip + 'course/course_normal/getChapterChildList';
//自由课程讨论章节列表
var url_discussList = ip + 'course/Discuss/getDiscussList';
//自由课程讨论章节添加讨论
var url_AdddiscussUrl = ip + 'course/Discuss/addDiscuss';
//自由课程讨论章节编辑讨论
var url_editDiscussUrl = ip + 'course/Discuss/editDiscuss';
//自由课程讨论章节删除讨论
var url_deleteDiscuss = ip + 'course/Discuss/delDiscuss';
//自由课程讨论章节回复讨论
var url_replayDiscuss = ip + 'course/Discuss/addcomment';
//自由课程评论列表
var url_Commentlist = ip + 'course/course_normal/getCommentList';
//自由课程删除评论
var url_delComment = ip + 'course/course_normal/delComment';
//自由课程回复评论
var url_replyComment = ip + 'course/course_normal/replyComment';
//自由课程发表评论
var url_Addcomment = ip + 'course/course_normal/addComment';
//自由课程获取用户是否参与过本调查状态
var url_completeSurvey = ip + 'course/Survey/completeSurvey';
//自由课程获取调查题目
var url_getSurvey = ip + 'course/Survey/getSurvey';
//自由课程提交调查结果
var url_subSurvey = ip + 'course/Survey/subSurvey';
//自由课程获取调查结果
var url_SurveyInfo = ip + 'course/Survey/getSurveyInfo';
/** 自由课程测验用户是否提交过本测验 */
var url_completeTest = ip + 'course/test/getuseranswertest';
//自由课程获取测验题目
var url_getTest = ip + 'course/test/getTest';
//自由课程提交测验
var url_subtest = ip + 'course/test/subtest';
//自由课程提交测验
//var url_subtest = ip + 'course/test/subtest';
//获取测验结果
var url_TestInfo = ip + 'course/test/getTestInfo';
//自由课程文件/文件夹获取章节内容
var url_getfile = ip + 'course/Videodetail/getfile';
//自由课程文件/文件夹章节介绍
var url_getCourseInfo = ip + 'course/course_normal/getCourseInfo';
//自由课程文件夹下文件
var url_getfolder = ip + 'course/Videodetail/getfolder';
//自由课程现场实操章节内容
var url_getSitenowInfo = ip + 'course/Sitenow_Normal/getSitenowInfo';
//自由课程现场实操获取评分表
var url_getSitenowScorelist = ip + 'course/Sitenow_Normal/getSitenowScorelist';
//自由课程现场实操查看成绩
var url_getSitenowRealdScore = ip + 'course/Sitenow_Normal/getSitenowRealdScore';
//自由课程现场实操评分上传
var url_setSitenowScore = ip + 'course/Sitenow_Normal/setSitenowScore';
//获取测验和调查章节状态
var url_getChapterType = ip + 'course/Survey/getStatus';
//自由课程作业获取内容
var url_getWork = ip + 'course/Work/getWork';
//自由课程提交作业
var url_subWork = ip + 'course/Work/subWork';
//老师批改作业时获取学生列表
//var url_getClassWorkList= ip + 'course/Work/getClassWorkList';
var url_getClassWorkList = ip + 'course/Work/getWorkList';
//视频课程章节列表


//教师端课程列表--new-2018-03-26
var url_teacherCourseListNew = ip + 'course/teacher_curriculum/getCurriculumList';

//老师端获取作业详情
var url_getTeacherWorks = ip + 'course/Work/getTeacherWorks';
//老师端获取作业
var url_getGetWorkTimes = ip + 'course/work/getWorkTime';
//老师端批阅作业
var url_teacherwork = ip + 'course/Work/teacherwork';
//教师端现场实操获取成绩
var url_getTeacherScore = ip + 'course/Sitenow_Normal/getTeacherScore';
//教师端现场实操获取小组成员
var url_getStudyList = ip + 'course/Sitenow_Normal/getStudyList';


////url前缀
//var urlPrefix = ip + '/index.php/';
//首页
var url_getApproveList = urlPrefix + 'approve/Index_Controller/index';

//我的认证
var url_myApprove = urlPrefix + 'approve/center/getUserApproveForApp';

//认证岗位-技能课程
var url_getSkillsList = urlPrefix + 'approve/Learn/getSkillsList';
//认证岗位-安全教育
var url_getsecurityList = urlPrefix + 'approve/Learn/getsecurityList';
//认证岗位-管理课程
var url_getProfessionalList = urlPrefix + 'approve/Learn/getProfessionalList';
//认证-申请考试
var url_applyTest = urlPrefix + '/approve/approve_status/addUserApplyExamTime';
//提交考试
var url_add_Test = urlPrefix + 'approve/Index_Controller/add_Test';
//开始考试
var url_startexam = urlPrefix + 'approve/Exam/startexamnew';
//获取测验结果
var url_getstore = urlPrefix + 'approve/Exam/getstore';
//申请纸质证书
var url_do_Get_Paper_Cert = urlPrefix + 'approve/Index_Controller/do_Get_Paper_Cert';
//实操考核提交
var url_addpractical = urlPrefix + 'approve/Exam/addpractical';
//我的证书列表
var url_showCert = urlPrefix + 'approve/Index_Controller/showCert';
//视频课程章节列表
var url_VideoCourseList = urlPrefix + 'approve/Learn/chapterlist';
//自由课程选择小组查看学生
var url_getSitenowScoreUser = urlPrefix + 'course/Sitenow_Normal/sorceUser';

//MOOC课程资料列表
var url_moocMateriaList = urlPrefix + 'course/course_normal/getMateria';
//课程浏览接口
var url_courseBrowsUrl = urlPrefix + 'course/course_normal/AddViewcount';
//老师课程列表
var url_teacherCourseList = urlPrefix + 'course/teacher_course_manage/getTeacherCourseInfoList';
//发布关闭章节
var url_closeOfOpenChapter = urlPrefix + 'course/Videodetail/closeVideodetail';
//问答列表
var url_questionAnswerList = urlPrefix + 'course/faq_normal/getFaqList';
//发表问题
var url_submitQuestion = urlPrefix + 'course/faq_normal/addFaq';
//回复问答列表
var url_replayQuestionList = urlPrefix + 'course/faq_normal/getReplyFaqList';
//回复问答
var url_replayQuestion = urlPrefix + 'course/faq_normal/addFaqReply';
//删除问答
var url_deleteQuestionOrReplay = urlPrefix + 'course/faq_normal/delFaq';
//删除回复
var url_deleteReply = urlPrefix + 'course/faq_normal/delFaqReply';
//笔记列表
var url_noteList = urlPrefix + 'course/course_normal/getNoteList';
//添加笔记
var url_addNote = urlPrefix + 'course/course_normal/addNote';
//删除笔记
var url_deleteNote = urlPrefix + 'course/course_normal/delNote';
//编辑笔记
var url_editNote = urlPrefix + 'course/course_normal/editNoteSave';
//老师批改下班级列表
var url_getClasslist = urlPrefix + 'course/Statistic/getClassInPlan';
//获取老师批改测验下班级学生列表
var url_getTestList = urlPrefix + 'course/test/getTestList';
////获取老师批改测验下班级学生列表测验章节详情
var url_getTestScoreList = urlPrefix + 'course/Test/getTestScoreList';
//培训轮播图
var url_trainRotation = urlPrefix + 'train/train_normal/getTrainLun';
//培训动态
var url_trainNews = urlPrefix + 'train/train_normal/getTrainNewsList';
//近期培训列表
var url_trainList = urlPrefix + 'train/train_normal/getTrainList';
//是否有新的待办事宜接口
var url_toDoMessage = urlPrefix + 'course/teacher_course_manage/getTeacherMessage';
//是否有新的待办事宜接口
var url_getClassroomMessage = urlPrefix + 'active/interaction/Message';
//课堂是否有新的待办事宜接口
var url_classroomMessage = urlPrefix + 'active/interaction/messagetext';
//待办事宜列表
var url_toDoMessageList = urlPrefix + 'course/teacher_course_manage/getTeacherNoList';
//学生消息列表
var url_stuMessageList = urlPrefix + 'course/teacher_course_manage/stuMessageList';
//全部设为已读
var url_toDoMessageAllSetRead = urlPrefix + 'course/teacher_course_manage/upTeacherMessage';
//设置阅读状态
var url_toDoMessageSetStatus = urlPrefix + 'course/teacher_course_manage/saveMessage';
//自由课程开始学习记录
var url_freeChapterStartRecord = urlPrefix + 'log/Free_Log/startFreeLog';
//自由课程停止学习记录
var url_freeChapterEndRecord = urlPrefix + 'log/Free_Log/endFreeLog';
//自由课程获取课程学习进度
var url_freeCourseSchedule = urlPrefix + 'course/course_normal/getSingilCourse';
//获取报名状态
var url_getTrainSignUpStatus = urlPrefix + 'train/train_normal/isAddTrain';

//新闻列表
var url_getNewList = urlPrefix + 'approve/Index_Controller/getApproveList';
//新闻详情
var url_getApproveDet = urlPrefix + 'approve/Index_Controller/getApproveDet';
//岗位分类
var url_getQuarterClassify = urlPrefix + 'approve/Quarter/getQuarterClassify';
//岗位列表
var url_getQuarterList = urlPrefix + 'approve/Quarter/getQuarterList';
//岗位详情
var url_getQuarterInfo = urlPrefix + 'approve/Quarter/getQuarterInfo';
//岗位报名
var url_Addapply = urlPrefix + 'approve/Quarter/Addapply';

//获取30天内可以报名的日期(周二，周五)
var url_applySelectTime = urlPrefix + 'approve/quarter/applySelectTime';
//岗位报名之后修改岗位信息
var url_AddPay = urlPrefix + 'approve/Quarter/addPay';
//支付宝异步通知地址
var url_AddPay_notify = urlPrefix + 'approve/pay/alipayNotify';
//岗位报名支付生成订单接口
var url_buypubpro = urlPrefix + 'approve/Pay/buypubpro';
//订单拼接参数
var url_orderparm = urlPrefix + 'approve/Payy/orderParam';
//岗位报名报名详情
var url_getApplyDet = urlPrefix + 'approve/index_controller/getApplyDet';
//老师端开启关闭答案
var url_releaseAnswer = urlPrefix + 'course/teacher_course_manage/releaseAnswer';
//获取开启/关闭答案状态
var url_isReleaseAnswer = urlPrefix + 'course/teacher_course_manage/isReleaseAnswer';

//7.93百度云上传附件
var Upload_baidu = 'http://train.cfnet.org.cn/api/learnplan/uploadfile';
//7.95阿里云上传图片
var Upload_pic = "http://biz.cfnet.org.cn/aliyun/samples/uploadfile.php";


//整合长风网首页新闻列表//
var url_getNewsFirstIndex = urlPrefix + 'user/Userlogin/app_Index';
//老师端首页的
var url_getTecherFirstIndex = urlPrefix + 'course/AppCourse/getAppLunBo';
//获取集团列表
var url_getjidList = urlPrefix + 'user/Userlogin/getJiTuanList';
//获取集团列表详情
var url_getNewsDetail = urlPrefix + 'user/Userlogin/getNewsDetail';

//课堂添加互动
var url_addActive = urlPrefix + 'active/interaction/addActive';
///获取互动列表接口
var url_activeList = urlPrefix + 'active/interaction/activeList';
///删除互动
var url_Delactive = urlPrefix + 'active/interaction/delActive';
///编辑互动

var url_EditActive = urlPrefix + 'active/interaction/editActive';


//获取调查问题详情
var url_getSurveryDetail = urlPrefix + 'active/interaction/getSurveryDetail';
//学生端获取互动列表
var url_stuGetActivelist = urlPrefix + 'active/interaction/stuGetActivelist';
//设置阅读状态
var url_classroomMessageSetStatus = urlPrefix + 'active/interaction/SaveMessage';
//学生端课堂提交调查接口
var url_postSurveryDetail = urlPrefix + 'active/interaction/postSurveryDetail';
//学生端获取调查结果
var url_getSurveryResult = urlPrefix + 'active/interaction/getSurveryResult';
//老师批改测验提交接口
var url_teachSubTest = urlPrefix + 'course/Test/teachSubTest';

//课堂班级
var url_class_list = urlPrefix + 'classes/classes/getClasses';
//获取学习计划列表
var url_plan_list = urlPrefix + 'course/course_normal/getUserPlanidList';
///active/interaction/ask
//互动详情
var url_ActiveInfo = urlPrefix + 'active/interaction/ask';
//课堂学生签到列表
var url_signInfoList = urlPrefix + 'active/interaction/signInfoList';
//课堂学生签到接口
var url_stuSignYesNo = urlPrefix + 'active/interaction/stuDoSign';
//教师批阅签到状态
var url_doSignList = urlPrefix + 'active/interaction/doSignList';
//编辑互动接口
//var url_getActive = urlPrefix +'active/interaction/getActive ';

//课堂讨论接口
//讨论列表接口
// var url_DiscussList = urlPrefix + 'active/interaction/activeList';
//讨论添加接口
var url_DiscussAdd = urlPrefix + 'active/interaction/addActive';
//讨论编辑接口
var url_DiscussEdit = urlPrefix + 'active/interaction/getActive';
//讨论更新接口
var url_DiscussUpdate = urlPrefix + 'active/interaction/editActive';
//讨论删除接口
var url_DiscussDel = urlPrefix + 'active/interaction/delActive';
//讨论详情接口
var url_DiscussInfo = urlPrefix + 'course/Discuss/getDiscussInfo';
//讨论评论列表接口
var url_DiscussCommentList = urlPrefix + 'course/Discuss/getDiscussCommentList';
//讨论评论点赞接口
var url_DiscussCommentPraise = urlPrefix + 'course/Discuss/thumbUp';
//讨论删除评论接口
var url_DiscussCommentDelete = urlPrefix + 'course/Discuss/delDiscussComment';
//讨论评论回复列表接口
var url_DiscussReplyList = urlPrefix + 'course/Discuss/getDiscussReplyList';
//讨论评论删除回复接口
var url_DiscussReplyDelete = urlPrefix + 'course/Discuss/delDissussReply';
//讨论发表评论接口
var url_DiscussCommentPub = urlPrefix + 'course/Discuss/addDissussComment';
//讨论发表回复接口
var url_DiscussReplyPub = urlPrefix + 'course/Discuss/addCommentReply';
//学生端讨论列表
var url_DiscussStuList = urlPrefix + 'active/interaction/stuGetActivelist';
//学生端单条讨论刷新
var url_DiscussSingle = urlPrefix + 'course/Discuss/getDiscussActivefind';
//获取单条评论
var url_DiscussSingleComment = urlPrefix + 'course/Discuss/getDiscussActiveCommentfind';
//获取单条回复
var url_DiscussSingleReply = urlPrefix + 'course/Discuss/getDiscussActiveReplyfind';


//精品课程评论列表
var url_PublicCommentList = urlPrefix + 'course/course_normal/getPublicCommentList';
//精品课程添加评论
var url_PublicAddComment = urlPrefix + 'course/course_normal/addPublicComment';

//提问名单接口
var url_askNameList = urlPrefix + 'active/interaction/getAskDetail';
//学生端的互动列表
var url_stuGetActivelist = urlPrefix + 'active/interaction/stuGetActivelist';

//互动创建获得日期编码
var url_getZcode = urlPrefix + 'active/interaction/getZcode';
//检测互动名称是否重复
var url_getZcodeValadataById = urlPrefix + 'active/interaction/getZcodeValadataById';

//课程考核相关接口

//学生端获取课程考核状态
var url_getCourseExamType = urlPrefix + 'match/exam/stuexamid';
//学生端获取课程考核获取考试token
var url_getCourseExamToken = urlPrefix + 'match/exam/startExam';
//学生端获取课程考核获取考试基本信息
var url_getCourseExamInfo = urlPrefix + 'match/exam/getExamInfo';
//学生端获取课程考核获取考试结果
var url_getCourseExamjiuguo = urlPrefix + 'match/exam/Examjiuguo';
//学生端获取课程考核获取考试题目
var url_getCourseExamQuestions = urlPrefix + 'match/exam/getExamQuestions';
//学生端获取课程考核提交
var url_CourseExamSubmit = urlPrefix + 'match/exam/submitExam';
//老师端考核批改
var url_CourseExamInfo = urlPrefix + 'match/exam/CourseExamInfo';
//老师端考核批改列表
var url_TeacherCourseExamList = urlPrefix + 'match/exam/TeacherCourseExam';
//单题提交接口
var url_doSubmitSingleQuestion = urlPrefix + 'match/exam/doSubmitSingleQuestion';
//获取已提交的题目答案
var url_getUserQuestionAnswer = urlPrefix + 'match/exam/getUserQuestionAnswer';


//反馈建议
var url_addSuggestion = urlPrefix + 'active/variable/addSuggestion';

//选课中心
//已选课程列表
var url_selectedCourseList = urlPrefix + 'active/variable/getVariableList';
//删除课程接口
var url_removeCourse = urlPrefix + 'active/variable/editVariable';
//添加课程接口
var url_addCourse = urlPrefix + 'active/variable/addCourseMessage';
//搜索历史接口
var url_searchHistory = urlPrefix + 'active/variable/getSearchlog';
//删除搜索历史
var url_removeSearchHistory = urlPrefix + 'active/variable/getSearchlog';
//搜索课程列表接口
var url_searchCourseList = urlPrefix + 'active/variable/getCourseList';
//课程分类接口
var url_courseCategory = urlPrefix + 'active/variable/getLessonCategory';

//退出/提交时记录自由课程学习状态
var url_EndRecordFreeChapterStudyTime = urlPrefix + 'log/free_Log/updateFreeStandardStatus';


//课程老师作业预览接口
var url_WorkPreview = urlPrefix + 'course/work/WorkPreview';

//选课中心修改订单状态
var url_updatepaystate = urlPrefix + 'approve/Pay/updatepaystate';

//获取调查参加人数
var url_getSurveyNum = urlPrefix + 'course/Survey/getSurveyNum';
//7.94企业师傅列表
var masterListUrl = urlPrefix + 'master/master/masterlist';


//获取视频token接口
var url_getVideoTokenUrl = 'http://boscache.cfnet.org.cn/bdyun/getVodVideoToken.php';

//学习进度统计列表
var url_getTongji = urlPrefix + 'course/teacher_course_manage/getTongji';

//学习进度章节列表进入
var url_getVideodetailtj = urlPrefix + 'course/videodetail/getVideodetailtj';

//章下子章节学习详情
var url_getSubChapterStudiedDetail = urlPrefix + 'course/videodetail/getChildersum';
//子章节学习进度
var url_subChapterStudiedInfo = urlPrefix + 'course/videodetail/getChilder';
//章下子章节学习详情老师
var url_teacherGetSubChapterStudiedDetail = urlPrefix + 'course/videodetail/getVideodetailsnum';

//判断章节是否需要更新
var url_isChapterUpdate = urlPrefix + "/Course/Active/isChapterUpdate";
//判断讨论是否需要更新
var url_isDiscussUpdate = urlPrefix + "/Course/Active/isDiscussUpdate";

//判断小组讨论是否需要更新
var url_isGroupDiscussUpdate = urlPrefix + "/Course/Active/isGroupDiscussUpdate";

//直播列表界面
var url_getBroadcast = urlPrefix + 'course/appcourse/getBroadcast';
//老师端测验章节统计详情
var url_getTestUserAnswerList = urlPrefix + 'Course/Active/getTestUserAnswerList';
//老师端测验章节统计人员详情
var url_getTestUserAnalysis = urlPrefix + 'Course/Active/getTestUserAnalysis';

//讨论创建小组
var url_CreateClassDiscuss = urlPrefix + 'course/discuss/CreateClassDiscuss';

// 获取班级列表
var url_getDiscussClasslist = urlPrefix + 'course/discuss/getDiscussClasslist';
//小组讨论获取当前学生身份
var url_isDiscussClass = urlPrefix + 'course/discuss/isDiscussClass';
//关闭当前讨论
var url_closeClassDissuss = urlPrefix + 'course/discuss/closeClassDissuss';
//小组讨论列表
var url_getClassDissussList = urlPrefix + 'course/discuss/getClassDissussList';
//回复小组讨论
var url_addClassDissuss = urlPrefix + 'course/discuss/addClassDissuss';
//提交总结
var url_subDissussConclude = urlPrefix + 'course/discuss/subDissussConclude';


//融云获取token
var getRongCloudToken = urlPrefix + 'rongyun/Example/getoken';
//融云获取课程群组
var getRongCloudCourseGroup = urlPrefix + 'rongyun/Example/CreateGroup';
//融云获取老师群组
var getRongCloudTeacherGroup = urlPrefix + 'rongyun/Example/CreateTeacherGroup';

//判断学生是否参加了学霸赛报名
var url_isUserSignUp = urlPrefix + 'Apply/Index/getApplyInfo';
//判断学生是否参加了学霸赛签到
var url_isUserSign = urlPrefix + 'Apply/Integral/isUserSign';
//学生学霸赛签到
var url_UserCompetitionSign = urlPrefix + 'Apply/Integral/doAddIntegral';
//学霸赛用户获取积分和排名
var url_getUserRank = urlPrefix + 'Apply/Rank/getUserRank';
//学霸赛添加足迹
var url_doAddUserFootprint = urlPrefix + 'Apply/Footprint/doAddUserFootprint';
////学霸赛挑战赛页地址
var url_XueBacontest = 'http://m.xueba.cfnet.org.cn/index.php/match/index/contest';
////学霸等你来页地址
var url_XueBaindex = 'http://m.xueba.cfnet.org.cn/index.php/match/index/index';
////学霸赛个人中心页地址
var url_XueBaminefootprint = 'http://m.xueba.cfnet.org.cn/index.php/match/index/minefootprint';

//学霸赛统计分析
var url_getxuebarecord = urlPrefix + 'course/teacher_course_manage/getxuebarecord';
//学霸赛章节图表
var url_XueBaSaiChart = urlPrefix + 'course/teacher_course_manage/xuebavideo';
//学霸赛子章节进度及难易度
var url_XueBaSaiSubChart = urlPrefix + 'course/teacher_course_manage/isxueba';
//获取老师批阅作业数
var url_TecGetWorkNum = urlPrefix + 'course/work/getWorkNum';
//长风模式申请
var url_cfnetModelApply = urlPrefix + 'course/teacher_course_manage/addTeacherApplication';

//实习首页
var url_trainIndex = urlPrefix + 'train/review/index';
//申请纸质证书修改信息
var url_addPayCate = urlPrefix + 'approve/Quarter/addPayCate';
var url_trainIndex = urlPrefix + 'train/review/index';
//霍兰德职业倾向分析
var url_HolanderDetail = urlPrefix + 'train/review/getReviewJieGuo';
//获取测评内容接口(除了霍兰德职业倾向)
var url_getReview = urlPrefix + 'train/review/getReview';
//开始测评获取Mid
var url_startReview = urlPrefix + 'train/review/startReview';
//提交测评数据(除了霍兰德职业倾向)
var url_addReview = urlPrefix + 'train/review/addReview';
//提交最后一道测评数据(除了霍兰德职业倾向)
var url_endReview = urlPrefix + 'train/review/endReview';
//提交第一部分题目(霍兰德职业倾向)
var url_addReviewFourone = urlPrefix + 'train/review/addReviewFourone';
//提交第二,三,四部分题目(霍兰德职业倾向)
var url_addReviewFour = urlPrefix + 'train/review/addReviewFour';
//提交最后一道题目(霍兰德职业倾向)
var url_endReviewFour = urlPrefix + 'train/review/endReviewFour';
//上传附件
var url_uploadSingleFiles = urlPrefix + 'pub/upload/uploadSingleFiles';
//实习学生学习课程列表接口
var url_trainStuCourseList = urlPrefix + 'train/study/getStudyList';


//获取学习计划列表
var url_getPlanList = urlPrefix + 'plan/Learningplan/getNewPlanList';
//添加学习计划
var url_AddPlan = urlPrefix + 'plan/Learningplan/addNewplan';
//删除学习计划
var url_delPlan = urlPrefix + 'plan/Learningplan/delNewplan';
//获取学习计划详情
var url_getPlanDetail = urlPrefix + 'plan/Learningplan/getPlanInfo';
//编辑学习计划
var url_editPlan = urlPrefix + 'plan/Learningplan/editNewplan';
//添加小组
var url_addPlanTeam = urlPrefix + 'plan/Learningplan/addNewplanTeam';
//删除小组
var url_delPlanTeam = urlPrefix + 'plan/Learningplan/delNewplanTeam';
//编辑小组名称
var url_editPlanTeamName = urlPrefix + 'plan/Learningplan/editNewplanTeamNames';
//学习计划小组列表
var url_planTeamList = urlPrefix + 'plan/Learningplan/getTeamList';
//小组成员列表
var url_planTeamStuList = urlPrefix + 'plan/Learningplan/getTeamPersonList';
//小组添加成员
var url_planTeamAddStu = urlPrefix + 'plan/Learningplan/addTeamStudents';
//小组删除成员
var url_planTeamDelStu = urlPrefix + 'plan/Learningplan/delTeamStudents';
//添加指导教师
var url_planCourseAddTeacher = urlPrefix + 'plan/Learningplan/addPlanAdviser';
//删除指导教师
var url_planCourseDelTeacher = urlPrefix + 'plan/Learningplan/delPlanAdviser';
//学习计划下课程指导教师列表
var url_planCourseTeacherList = urlPrefix + 'plan/Learningplan/getPlanInstructor';

//学习计划中班级列表班级中人员列表
var url_StudyPlanGetStaffList = urlPrefix + 'plan/Learningplan/getClassList';
//获取课程详情点击事件
var url_GetChapterById = urlPrefix + 'course/Videodetail/getChapterById';

//学习计划已选课程列表
var url_planCourseList = urlPrefix + 'plan/Learningplan/getAddCourseList';

//删除学习计划中课程
var url_delPlanCourse = urlPrefix + 'plan/Learningplan/delplanCourse';

//未选课程列表
var url_planSearchCourseList = urlPrefix + 'plan/Learningplan/getNoCourseList';

//学习计划添加课程
var url_addPlanCourse = urlPrefix + 'plan/Learningplan/addNewplanCourse';

//单个用户各类型积分统计接接口
var url_getUserPointStatistics = urlPrefix + 'points/getpoints/getUserFootPointStatistics';

//获取积分列表（进度和积分）
var url_getUserPointsList = urlPrefix + 'points/Getpoints/getUserFootPointsList';

//查看积分明细
var url_getPointsDetails = urlPrefix + 'points/setpoints/getPointsDetails';
//查看用户总积分
var url_getUserAllPoints = urlPrefix + 'points/setpoints/getUserAllPoints';
//竞赛首页
var url_competitionindex = urlPrefix + 'match/Match/getindexinfos';
//获取竞赛申请表字段
var url_competitionapplymatchinfo = urlPrefix + 'match/Match/applymatchinfo';
//提交申请竞赛信息
var url_competitiondoapplymatch = urlPrefix + 'match/Match/doapplymatch';
//学生端获取总积分
var url_getPointTotal = urlPrefix + 'points/getpoints/getPointTotal';
//学生个人轨迹通过当前年份查询存在行为轨迹的月份
var url_getContrailMonth = urlPrefix + 'points/Getpoints/getContrailMonth';
//学生个人轨迹通过当前月份查询存在行为轨迹的日期
var url_getContrailDay = urlPrefix + 'points/Getpoints/getContrailDay';
//学生个人轨迹通过当前日期查询当日的行为轨迹
var url_getPointsContrail = urlPrefix + 'points/Getpoints/getPointsContrail';
//获取教师下的学生积分列表
var url_getTeacherForStudentPointList = urlPrefix + 'points/Getpoints/getTeacherForStudentPointList';
//获取多个集团下用户的身份接口(如果存在一个集团老师身份,默认是老师身份)
var url_checkUserRole = urlPrefix + 'points/Getpoints/checkUserRole';
//积分呢老师是端获取学生积分排行列表
var url_getTeacherPointTotal = urlPrefix + 'points/getpoints/getTeacherPointTotal';
//我的支付记录
var url_mypurchase = urlPrefix + 'match/Buy/mypurchase';
//竞赛列表
var url_jingSaiList = urlPrefix + 'match/Mycompetition/getcompetition';
//签到、提问开始、结束接口
var url_actionDosign = urlPrefix + 'active/interaction/dosign';
//提问名单列表
var url_getaskNameList = urlPrefix + 'active/interaction/askNameList';
//提问名单
var url_doAsk = urlPrefix + 'active/interaction/doAsk';


//互评打分结束
var url_actionDosign = urlPrefix + 'active/interaction/dosign';

//学生互评历史
var url_StugetMutualEvaluationRecord = urlPrefix + 'active/interaction/getMutualEvaluationRecord';
//老师互评历史
var url_getTeacherMutualEvaluationList = urlPrefix + 'active/interaction/getTeacherMutualEvaluationList';
//互评详情
var url_getMutualEvaluation = urlPrefix + 'active/interaction/getMutualEvaluation';
//学生端 展示被投票人信息
var url_getDetailsOfScore = urlPrefix + 'active/interaction/getDetailsOfScore';
//获取互动状态
var url_getActiveStatus = urlPrefix + 'active/interaction/getActiveStatus';
//互动打分
var url_stuDoSign = urlPrefix + 'active/Interaction/stuDoSign';
//学生互动类型
var url_getActiveStudentStatus = urlPrefix + 'active/Interaction/getActiveStudentStatus';
//获取投票详情
var url_getDetailsOfVoting = urlPrefix + 'active/interaction/getDetailsOfVoting';
//获取签到二维码
var url_getSignQrcodeActive = urlPrefix + 'active/Interaction/getSignQrcodeActive'
//获取投票状态(适用于老师端)
var url_getVoteActiveStatus = urlPrefix + 'active/interaction/getActiveStatus'
//实习获取报告日历详情接口
var url_getCalenderDetail = urlPrefix + 'train/Presentation/getStudentCalendar';

//获取我的应用接口
var url_getMyApplicationUrl = urlPrefix + 'examsystem/index/getUserExamList';
//获取pc是否开启
var url_getActiveSourceConductStatus = urlPrefix + 'active/Interaction/getActiveSourceConductStatus';
//实习考核列表
var url_getExamStudentList = urlPrefix + 'train/study/getExamStudentList';
//判断实习考核状态(判断是否第一次参加考试)
var url_getExamStatus = urlPrefix + 'match/exam/getExamStatus';
//师傅端徒弟列表
var url_getApprenticeList = urlPrefix + 'train/Presentation/getApprenticeList';
//师傅端评分接口
var url_putEnterpriseScore = urlPrefix + 'train/Presentation/putEnterpriseScore';
//师傅端评分列表
var url_getScoreList = urlPrefix + 'train/Presentation/getScoreList';
//师傅端评分列表详情
var url_getStudentInternshipinfo = urlPrefix + 'train/Presentation/getStudentInternshipinfo';
////师傅端报告列表(暂时不用)
//var url_sflst = urlPrefix + 'master/master/sflst';
//周报列表获取时间(当前1个月内的所有周一到周日的日期段)
var url_getWeek = urlPrefix + 'train/train_date/getWeek';
//日报报列表获取时间(当前1个年内的)
var url_getDay = urlPrefix + 'train/train_date/getDay';

//实习学生轨迹
var url_getStudentTrajectory = urlPrefix + 'train/Presentation/getStudentTrajectory';
//实习学生轨迹详情
var url_getStudentInternshipDetails = urlPrefix + 'train/Presentation/getStudentInternshipDetails';
//实习老师端管理企业分布
var url_getTeacherManageStatistics = urlPrefix + 'train/Presentation/getTeacherManageStatistics';
//实习老师端管理列表
var url_getTeacherManage = urlPrefix + 'train/Presentation/getTeacherManage';

//企业师傅端管理月报列表接口
var url_sflst = masterIp + 'master&a=sflst';
//7.87企业师傅端管理列表详情
var url_sfinfo = masterIp + 'master&a=sfinfo';
//7.88企业师傅端管理评价接口
var url_sfevaluate = masterIp + 'master&a=sfevaluate';
//师傅端代办事宜
var url_getMasterNoList = urlPrefix + 'course/teacher_course_manage/getMasterNoList';


//学生日报详情
var url_getStudentCalendar = urlPrefix + 'train/Presentation/getStudentCalendar';
//实习学习人员积分列表
var url_trainUserIntegral = urlPrefix + 'points/Getpoints/getInternshipUserFootPointsList';
//修改个人信息
var editactOne = urlPrefix + 'user/user/editactOne';
//添加个人信息
var applstOne = urlPrefix + 'user/user/applstOne';

//老师下的所以课程
var url_courseAll = urlPrefix + 'user/Userteacher/Teachercourse';

//精彩瞬间相关接口
//提交精彩瞬间
var url_submitSpontaneousMomentsPics = urlPrefix + 'active/Moments/addUserImagesApp';
//获取精彩瞬间列表
var url_getSpontaneousMomentsList = urlPrefix + 'active/Moments/getImage';
//获取某一天精彩瞬间图片
var url_getOneDaySpontaneousMomentsPics = urlPrefix + 'active/Moments/getImageByDate';
//获取精彩瞬间图片详情
var url_loadSpontaneousMonmentsDetail = urlPrefix + 'active/Interaction/getAppPhotocomment';
//获取精彩瞬间评论列表
var url_loadSpontaneousmonmentsCommentList = urlPrefix + 'active/Interaction/getAppComment';
//提交精彩瞬间图片评论
var url_submitSpontaneousMomentsComment = urlPrefix + 'active/Interaction/getPhotocommentAdd';

//师傅端周报列表接口
var urlmastersfwk = urlPrefix + 'train/master/sfwk';
//师傅端日报列表接口
var urlmastersfrblst = urlPrefix + 'train/master/sfrblst';
//师傅端月报列表接口
var urlmastersfmonth = urlPrefix + 'train/master/sfmonth';

//7.87企业师傅端管理列表详情
var urlmasterssfinfo = urlPrefix + 'train/Master/sfinfo';
//7.88企业师傅端管理评价接口
var urlmasterssfevaluate = urlPrefix + 'train/Master/sfevaluate';
//企业hr管理的仓库（企业）
var urlhrqylst = urlPrefix + 'train/Hr/hrqylst';
//企业hr管理的仓库下得岗位
var urlhrqygwlst = urlPrefix + 'train/Hr/hrqygwlst';

//企业hr的签到
var urlhrseesign = urlPrefix + 'sign/Hrsign/hrseesign';
//企业hr的月报
var urlhrmonth = urlPrefix + 'sign/Hrsign/hrmonth';
//企业hr的周报
var urlhrwk = urlPrefix + 'sign/Hrsign/hrwk';
//企业hr的日报
var urlhrrblst = urlPrefix + 'sign/Hrsign/hrrblst';
//企业hr管理
var urlHRgetStudentlst = urlPrefix + 'sign/Hrsign/getStudentlst';

//企业hr下的仓库
var urlHRcompanylst = urlPrefix + 'sign/hrsign/companylst';
//企业hr下的仓库-的岗位
var urlHRgwlst = urlPrefix + 'sign/hrsign/gwlst';
//企业hr下的仓库-岗位-学生排名
var urlHRgwCourseExamlst = urlPrefix + 'sign/hrsign/gwCourseExamlst';

//二维码扫描加入学习计划
var url_joinStudyPlanByQrcode = urlPrefix + 'plan/study_plan/joinStudyPlanByQrcode';

//蓝血计划获取当前打卡数据
var url_getPunchClock = urlPrefix + 'optimizeapi/Clock/getList';
//蓝血计划记录打卡数据
var url_recordPunchClock = urlPrefix + 'optimizeapi/Clock/add';
//蓝血计划记录分享数据
var url_recordShareData = urlPrefix + 'optimizeapi/Clock/addtShare';


//实习改版接口
//首页轮播图接口
var url_newPracticeRotation = urlPrefix + 'train/v2/index/index';
//岗位列表接口
var url_newPracticePostList = urlPrefix + 'train/v2/index/jobList';
//企业列表接口
var url_newpracticeCompanyList = urlPrefix + 'train/v2/index/companyList';
//企业详情接口
var url_newPracticeCompanyDetail = urlPrefix + 'train/v2/index/companyDetails';
//资讯列表接口
var url_newPracticeNewsList = urlPrefix + 'train/v2/index/informationList';
//实习企业岗位搜索接口
var url_newPracticeSearch = urlPrefix + 'train/v2/index/searchEnterprisePosts';
//实习申请接口
var url_newPracticeApply = urlPrefix + 'train/v2/index/jobApply';
//推荐课程接口
var url_newPracticeRecommendCourse = urlPrefix + 'train/v2/index/recommendCourse';
//已实习首页接口
var url_newPracticeDetail = urlPrefix + 'train/v2/index/practice';
//实习推荐课程接口
var url_newPracticeCourse = urlPrefix + 'train/v2/index/recommendCourse';
//调岗申请接口
var url_newPracticeTransferPost = urlPrefix + 'train/v2/index/transferPositionApply';
//师傅端调岗列表接口
var url_newPracticeApplyList = urlPrefix + 'train/v2/index/masterPostApply';
//师傅端评分接口
var url_newPracticeScore = urlPrefix + 'train/v2/index/masterComments';
//获取评语标签列表接口
var url_newPracticeScoreTagList = urlPrefix + 'train/v2/index/commentsTag';
//获取评语接口
var url_newPracticeComment = urlPrefix + 'train/v2/index/masterCommentsInfo';
//同意调岗申请接口
var url_newPracticeAgreeOrRefuseApply = urlPrefix + 'train/v2/index/agreeApply';
//岗位确认接口
var url_newPracticePostConfirm = urlPrefix + 'train/v2/index/postsConfirm';


//获取课程
var url_train_getCourseList = ip + 'newtrain/course/getCourseList';
//获取课程数量
var url_train_getCourseNum = ip + 'newtrain/course/getCourseNum';
//获取班级
var url_train_getClassList = ip + 'newtrain/Trainclass/getClassList';
//获取班级数量
var url_train_getClassNum = ip + 'newtrain/Trainclass/getClassNum';
//获取最新班级
var url_train_getNewClassList = ip + 'newtrain/Trainclass/getNewClassList';
//获取新闻
var url_train_getNewsList = ip + 'newtrain/Trainnews/getNewsList';
//获取我的订单列表
var url_train_getOrderList = ip + 'newtrain/Trainorder/getOrderList';
//获取我的订单数量
var url_train_getOrderNum = ip + 'newtrain/Trainorder/getOrderNum';
//获取我的订单一个
var url_train_getOrder = ip + 'newtrain/Trainorder/getOrder';
//获取订单状态状态可学习
var url_train_getOrderStatus = ip + 'newtrain/Trainorder/getOrderStatus';
//获取收藏状态
var url_train_getCollection = ip + 'newtrain/Collection/getCollection';
//收藏接口
var url_train_changeCollection = ip + 'newtrain/Collection/changeCollection';
//获取单独班级信息
var url_train_getClass = ip + 'newtrain/Trainclass/getClass';
//获取单独课程信息
var url_train_getCourse = ip + 'newtrain/Course/getCourse';
//获取课程评价
var url_train_getCourseComments = ip + 'newtrain/Course/getCourseComments';
//获取收藏列表
var url_train_getCollectionList = ip + 'newtrain/collection/getCollectionList';
//添加评论
var url_train_addComment = ip + 'newtrain/Course/addComment';
//获取章节列表
var url_train_getCourseChapters = ip + 'newtrain/Course/getCourseChapters';
//获取班级内课程列表
var url_train_getRelationCourse = ip + 'newtrain/Course/getRelationCourse';
//报名
var url_train_signup = ip + 'newtrain/Apply/save';
//获取订单
var url_getOrderInfo = ip + 'newtrain/Trainorder/getProductId';

//获取订单状态
var url_train_orderState = ip + 'newtrain/Trainorder/getUserProductOrder';

//获取报名详情
var url_train_info = ip + 'newtrain/Apply/read';
//获取实习方向
var url_train_learningDirection = ip + 'newtrain/Courseextend/getLearningDirection';
//获取公共活跃圈子数
var url_ring_publicNumber = ip + 'circle/v1/webim/getMsgTotal';
//我的私有圈子
var url_ring_mine = ip + 'circle/v1/webim/myGroupList';
//获取我的环信信息
var url_ring_register = ip + 'circle/v1/webim/registerUser';
//公共那个圈子列表
var url_ring_other = ip + 'circle/v1/webim/comGroupList';
//获取群成员列表
var url_ring_people = ip + 'circle/v1/webim/groupMemberList';
//获取历史消息
var url_ring_history = ip + 'circle/v1/webim/getHistoryMsg';
//上传消息
var url_ring_updateMsg = ip + 'circle/v1/Webim/addMsg';
//标记最后一条消息已读
var url_ring_tagRead = ip + 'circle/v1/Webim/readMsgRecord';
var url_plan_joinClass = ip + 'plan/Yktclassroom/codeJoinClass';


var MD5 = function (string) {

    function RotateLeft(lValue, iShiftBits) {
        return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
    }

    function AddUnsigned(lX, lY) {
        var lX4, lY4, lX8, lY8, lResult;
        lX8 = (lX & 0x80000000);
        lY8 = (lY & 0x80000000);
        lX4 = (lX & 0x40000000);
        lY4 = (lY & 0x40000000);
        lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
        if (lX4 & lY4) {
            return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
        }
        if (lX4 | lY4) {
            if (lResult & 0x40000000) {
                return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
            } else {
                return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
            }
        } else {
            return (lResult ^ lX8 ^ lY8);
        }
    }

    function F(x, y, z) {
        return (x & y) | ((~x) & z);
    }

    function G(x, y, z) {
        return (x & z) | (y & (~z));
    }

    function H(x, y, z) {
        return (x ^ y ^ z);
    }

    function I(x, y, z) {
        return (y ^ (x | (~z)));
    }

    function FF(a, b, c, d, x, s, ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function GG(a, b, c, d, x, s, ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function HH(a, b, c, d, x, s, ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function II(a, b, c, d, x, s, ac) {
        a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
        return AddUnsigned(RotateLeft(a, s), b);
    };

    function ConvertToWordArray(string) {
        var lWordCount;
        var lMessageLength = string.length;
        var lNumberOfWords_temp1 = lMessageLength + 8;
        var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
        var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
        var lWordArray = Array(lNumberOfWords - 1);
        var lBytePosition = 0;
        var lByteCount = 0;
        while (lByteCount < lMessageLength) {
            lWordCount = (lByteCount - (lByteCount % 4)) / 4;
            lBytePosition = (lByteCount % 4) * 8;
            lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
            lByteCount++;
        }
        lWordCount = (lByteCount - (lByteCount % 4)) / 4;
        lBytePosition = (lByteCount % 4) * 8;
        lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
        lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
        lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
        return lWordArray;
    };

    function WordToHex(lValue) {
        var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount;
        for (lCount = 0; lCount <= 3; lCount++) {
            lByte = (lValue >>> (lCount * 8)) & 255;
            WordToHexValue_temp = "0" + lByte.toString(16);
            WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
        }
        return WordToHexValue;
    };

    function Utf8Encode(string) {
        string = string.replace(/\r\n/g, "\n");
        var utftext = "";

        for (var n = 0; n < string.length; n++) {

            var c = string.charCodeAt(n);

            if (c < 128) {
                utftext += String.fromCharCode(c);
            } else if ((c > 127) && (c < 2048)) {
                utftext += String.fromCharCode((c >> 6) | 192);
                utftext += String.fromCharCode((c & 63) | 128);
            } else {
                utftext += String.fromCharCode((c >> 12) | 224);
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                utftext += String.fromCharCode((c & 63) | 128);
            }

        }

        return utftext;
    };

    var x = Array();
    var k, AA, BB, CC, DD, a, b, c, d;
    var S11 = 7, S12 = 12, S13 = 17, S14 = 22;
    var S21 = 5, S22 = 9, S23 = 14, S24 = 20;
    var S31 = 4, S32 = 11, S33 = 16, S34 = 23;
    var S41 = 6, S42 = 10, S43 = 15, S44 = 21;

    string = Utf8Encode(string);

    x = ConvertToWordArray(string);

    a = 0x67452301;
    b = 0xEFCDAB89;
    c = 0x98BADCFE;
    d = 0x10325476;

    for (k = 0; k < x.length; k += 16) {
        AA = a;
        BB = b;
        CC = c;
        DD = d;
        a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
        d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
        c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
        b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
        a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
        d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
        c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
        b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
        a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
        d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
        c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
        b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
        a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
        d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
        c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
        b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
        a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
        d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
        c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
        b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
        a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
        d = GG(d, a, b, c, x[k + 10], S22, 0x2441453);
        c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
        b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
        a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
        d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
        c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
        b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
        a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
        d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
        c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
        b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
        a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
        d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
        c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
        b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
        a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
        d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
        c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
        b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
        a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
        d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
        c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
        b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
        a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
        d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
        c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
        b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
        a = II(a, b, c, d, x[k + 0], S41, 0xF4292244);
        d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
        c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
        b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
        a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
        d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
        c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
        b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
        a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
        d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
        c = II(c, d, a, b, x[k + 6], S43, 0xA3014314);
        b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
        a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
        d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
        c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
        b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
        a = AddUnsigned(a, AA);
        b = AddUnsigned(b, BB);
        c = AddUnsigned(c, CC);
        d = AddUnsigned(d, DD);
    }

    var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d);

    return temp.toLowerCase();
}
